import React from 'react';
import { View, Text } from 'react-native';
import t from 'tcomb-form-native';
var Component = t.form.Component;

// extend the base Component
class Title extends Component {
  // this is the only required method to implement
  getTemplate() {
    // define here your custom template
    return function(locals) {
      if (locals.hidden) {
        return null;
      }
      return (
        <Text
          style={[
            {
              backgroundColor: '#eee',
              padding: 10,
              fontSize: 20,
              marginBottom: 10,
              color: '#333'
            },
            locals.config.styles
          ]}
        >
          {locals.label}
        </Text>
      );
    };
  }
  getLocals() {
    const locals = super.getLocals();
    return locals;
  }
}

export default Title;
